#include"AbstructFactory.h"
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <thread>
using namespace std;

Monster* concreteFactory1::createShooter() {
    vt.push_back(new Shooter1());
//    return new Shooter1();
}

Monster* concreteFactory1::createMaster() {
    vt.push_back(new Master1());
//    return new Master1();
}

Monster* concreteFactory1::createMeatshield() {
    vt.push_back(new Meatshield1());    
//    return new Meatshield1();
}

Monster* concreteFactory2::createShooter() {
    vt.push_back(new Shooter2());
//    return new Shooter2();
}

Monster* concreteFactory2::createMaster() {
    vt.push_back(new Master2());
//    return new Master2();
}

Monster* concreteFactory2::createMeatshield() {
    vt.push_back(new Meatshield2());    
//    return new Meatshield2();
}

void concreteFactory1::createMonster() {
    srand((unsigned)time(NULL)); 
    int num = 5;
    while(num--) {
        int i = rand() % 3;
        if(i == 0) createShooter();
        else if(i == 1) createMaster();
        else if(i == 2) createMeatshield();
    }
}
void concreteFactory2::createMonster() {
    srand((unsigned)time(NULL));
    int num = 5;
    while(num--) {
        int i = rand() % 3;
        if(i == 0) createShooter();
        else if(i == 1) createMaster();
        else if(i == 2) createMeatshield();
    } 
}